<?php
/*
Template Name: image
*/
?>

<?php global $options; foreach ($options as $value) {if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }}?>
<?php get_header(); ?>

<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/ReMooz.css" type="text/css" media="all" />
<link type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/css/jd.gallery.css" rel="stylesheet" />


<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/ReMooz.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jd.gallery.js"></script>

		<script type="text/javascript">
			function startGallery() {
				var myGallery = new gallery($('singlegallery'), {
					timed: false,
					useReMooz: true,
					embedLinks: false
				});
			}
			window.addEvent('domready',startGallery);
		</script>


<div class="main_page">

	<div class="main_left_single">
	
				<div class="mediasingle_item">						

						<div id="singlegallery">
					<?php while (have_posts()) : the_post(); 
					if ($images = get_children(array(
						'post_parent' => $post->ID,
						'post_type' => 'attachment',
						'post_mime_type' => 'image',
						'order' => 'ASC',
						'orderby' => 'menu_order')))  
					 foreach($images as $image) {  
						$exehill_image = $image->guid; 
						$exehill_thumb = wp_get_attachment_thumb_url( $image->ID);
						$exehill_title = $image->post_title;
      				    $exehill_description = $image->post_content;?>	
						 

				<div class="imageElement">
					<h3><?php echo $exehill_title; ?></h3>
					<p><?php echo $exehill_description; ?></p>
					<a href="<?php echo $exehill_image; ?>" title="open image" class="open"></a>
					<img src="<?php echo $exehill_image; ?>" class="full" />
					<img src="<?php echo $exehill_thumb; ?>" class="thumbnail" />

					
				</div>
	

					
						 <?php } ?>
			</div> 
					
		</div>

		<div class="main_left_top"><?php the_title(); ?>
		</div>

		<div class="imagesingle_text">
		
		<div><?php the_content(); ?>
		
		</div>
	  
	    <div class="post_single_footer"><span class="post_time"><?php the_time('M j, Y') ?></span><span class="post_single_tags"><?php echo get_the_tag_list( '',' - '); ?></span>
		</div>	

		
	
		<div class="imagesingle_comments">
		<?php comments_template(); ?>
		</div>
		
	</div>
	
		<div class="main_left_bottom">
		</div>
</div>
	<?php endwhile; ?>

<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/dbx_init_2.js"></script>

<div class="main_right">
	<?php get_sidebar(); ?>
</div>
	
	<div class="clear">
	</div>
	
</div>

<?php get_footer(); ?>
